package chances.training.lombok;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;

@SpringBootApplication
@Slf4j(topic = "chances.system")
public class TrainingLobomApplication {

	public static void main(String[] args) {
		SpringApplication.run(TrainingLobomApplication.class, args);
		log.info("Traning Lobom {}","Coffee");
	}

	 public static void copy(String src ,String target) throws IOException {
	        @Cleanup InputStream in = new FileInputStream(src);
	        @Cleanup OutputStream out = new FileOutputStream(target);
	        byte[] b = new byte[10000];
	        while (true) {
	            int r = in.read(b);
	            if (r == -1) break;
	            out.write(b, 0, r);
	        }
	    }
}
